Repository navigation
Conversation
Comparing a decimal with a random string literal makes the server convert
the string to the decimal type. A string starting with e/E enters the
decimal reader's exponent branch, which throws CANNOT_PARSE_NUMBER
("Cannot parse exponent while reading decimal", or "Exponent is out of
range while reading decimal" when the exponent overflows Int32), and
convertFieldToType passes it through instead of rewriting it to
TYPE_MISMATCH "Cannot convert string". The integer and float readers'
wordings for the same shape are already expected; these two were not, so
CODDTest reported the raw SQLException (NightlySQLancer, SQLancer
(arm_release), master 9c5336e66e25, 2026-11-28).
Related: ClickHouse/ClickHouse#128538
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The 2026-11-28 master nightly (
SQLancer (arm_release), reproducer) reported this fromCODDTest:Comparing a decimal with a random string makes the server convert the string to the decimal type, and an error is the right answer for
'e-y*ZLG'. A string that starts withe/Eenters the decimal reader's exponent branch, which throwsCANNOT_PARSE_NUMBER(Cannot parse exponent while reading decimal, orExponent is out of range while reading decimalwhen the exponent overflows), andconvertFieldToTypepasses it through instead of rewriting it toCannot convert stringas it does for'abc'.ClickHouseErrorsalready lists the integer and float readers' wordings for this shape (Cannot parse number without any digits,Cannot read floating point value, ...) but not these two, so the rawSQLExceptionbecame a finding.This adds both wordings to
getExpectedExpressionErrors().Checked against master 26.12.1.1 (debug build,
.claude/clickhouse-config/overrides):errorIsExpected(<CI message>), and the same for the out-of-range message (SELECT CAST(1 AS Decimal(5, 2)) <> '.01e-2147483647')false,falsetrue,trueCODDTest, 4 threads, 5 min, local-only patch prefixing 1 in 4Randomly.getString()results withe-CODDTest, unbiased, 10 threads, 10 min'e'vsDecimal(13, 3))mvn verify -DskipTests=true -Djacoco.skip=truepasses with 0 Checkstyle violations.Related: ClickHouse/ClickHouse#128538
🤖 Generated with Claude Code